<script>
var sortbase='<*sortbase*>';
var sortdir='<*sortdir*>';
var sortby='<*sortby*>';
</script>
<input type="Hidden" id="sortbase_hidden" value="<*sortbase*>">

<div id="tabs">
{if $tabs}
	<*tabs*>
{else}
	{if $listtitle} 
		<div class="active color"><*listtitle*></div><div class="activeround"></div>
	{/if}	
{/if}
{if !$disable_add}
	<div id="listadd" style="float:right;"><img src="images/add.gif"> <a rel="{echo LinkBuilder('');}" onclick="return aform(this.rel)" style="cursor:pointer;">добавить</a></div>
{/if}
</div>

<div id="list">
{if $navigator}<*navigator*>{/if}
{if $filter}<*filter*>{/if}
<div id="listloader" style="display:none;">идёт загрузка данных</div>
<table id="listtable">
		<tr id="header">
			<td id="num" class="clickable" onclick="sorta('pos')">#{if $_REQUEST["sortby"]=="pos"}<img src="images/{echo $_REQUEST["sortdir"]}.gif" class="sortimg">{/if}</td>
			<td id="sep"></td>
			<td id="title" class="clickable" onclick="sorta('title')">Заголовок{if $_REQUEST["sortby"]=="title"}<img src="images/{echo $_REQUEST["sortdir"]}.gif" class="sortimg">{/if}</td>
			<td id="sep"></td>

{for source=columns}
	{if $sortable}
		<td class="clickable" onclick="sorta('<*key*>')" {if $width} style="width:<*width*>px;" {/if}><*title*>{if $_REQUEST["sortby"]==$key}<img src="images/{echo $_REQUEST["sortdir"]}.gif" class="sortimg">{/if}</td>
	{else}
		<td {if $width} style="width:<*width*>px;" {/if}><*title*></td>
	{/if}
	<td id="sep"></td>
{/for}
			
			<td id="actions"></td>
			<td id="sep"></td>
			<td id="ids" class="clickable" onclick="sorta('id')">ID{if $_REQUEST["sortby"]=="id"}<img src="images/{echo $_REQUEST["sortdir"]}.gif" class="sortimg">{/if}</td>
			<td id="sep"></td>			
			<td id="delete" class="clickable"><a href="{echo LinkBuilder('formaction=delete&id=',true)}" onclick="return massDelete(this.href)"><img src="images/cancel.gif" alt="Удалить выбранные" title="Удалить выбранные"></a></td>
		</tr>

{if $back}
	<tr class="even" onmouseout="this.style.background='#F6F6F6'" onmouseover="this.style.background='#E4F5B2'">
	<td id="back"><img src="images/back.gif" alt=""></td>
	<td></td>
	<td id="title"><a href="<*back*>">..назад</a></td>
	<td colspan="12"></td>
	</tr>		
{/if}
		
{for source=rows}
<tr {if $i%2} class="odd" onmouseout="this.style.background='#FFF'" {else} class="even"  onmouseout="this.style.background='#F6F6F6'" {/if} id="row<*i*>" onmouseover="this.style.background='#E4F5B2'">
	
	<td id="num"><*row_number*>.</td>
	<td></td>
	<td id="title">
	
	{if $icon}
		<img src="images/<*icon*>" alt=""> 
	{/if}
	{if $picturefile}
		{if $titlelink}<a href="<*titlelink*>">{else}<a href="{echo LinkBuilder('formaction=edit&id=<*id*>&pager=')}" onclick="return aform(this.href)">{/if}<img onmouseout="reset_image_window();" onmousemove="show_image_window('<*picturefile*>?rand={echo time();}',event);" src="images/hasimage.gif" alt="" style="display:inline;margin-right:5px;"></a>
	{/if}	
	{if $titlelink}	<a href="<*titlelink*>"> {else} <a href="{echo LinkBuilder('formaction=edit&id=<*id*>&pager=')}" onclick="return aform(this.href)"> {/if}
	<*title*>
	</a>

	{if $listinfo} <br><span style="font-size:11px;"><*listinfo*></span> 	{/if}
	</td>
	<td></td>

	{for source=columns}
		<td id="title"><*<*key*>*></td>
		<td></td>
	{/for}
	
	<td id="listbuttons">
				<div class="contextmenu" id="cm<*i*>" onmouseout="closeMenu(<*i*>);" onmouseover="cancelClose(<*i*>);">
					<ul>
					{if !$disable_edit}
					<li onmouseover="this.style.background='#D4ED8A'" onmouseout="this.style.background='#FFF'"><a href="{echo LinkBuilder('formaction=edit&id=<*id*>')}" onclick="return aform(this.href)">Редактировать</a></li>
					{/if}
					{if $buttons}
						{for source=buttons}
						<li onmouseover="this.style.background='#D4ED8A'" onmouseout="this.style.background='#FFF'"><a href="<*url*>" {if $ajax} onclick="return alist(this.href)" {/if}><*title*></a></li>
						{/for}
					{/if}
					{if $haspos}
						<li onmouseover="this.style.background='#D4ED8A'" onmouseout="this.style.background='#FFF'"><a href="{echo LinkBuilder('formaction=moveup&id=<*id*>')}" onclick="return alist(this.href)">Переместить вверх</a></li>
						<li onmouseover="this.style.background='#D4ED8A'" onmouseout="this.style.background='#FFF'"><a href="{echo LinkBuilder('formaction=movedown&id=<*id*>')}" onclick="return alist(this.href)">Переместить вниз</a></li>
					{/if}
					{if !$disable_delete}
					<li onmouseover="this.style.background='#D4ED8A'" onmouseout="this.style.background='#FFF'"><a href="{echo LinkBuilder('formaction=delete&id=<*id*>')}" onclick="return alist(this.href)">Удалить</a></li>
					{/if}
					</ul>
				</div>
				<span id="actbutton<*i*>" onmouseout="closeMenu(<*i*>);" onmouseover="cancelClose(<*i*>);" onclick="show_action(<*i*>);return false;">Действия</span>
				{if !$disable_edit}<a href="{echo LinkBuilder('formaction=edit&id=<*id*>')}" onclick="return aform(this.href)"><img src="images/edit.gif"></a>{else}<img src="images/no.gif" width="1" height="18">{/if}</td>
				
			<td></td>
			<td id="ids"><*id*></td>
			<td></td>
			<td align="center"><input type="Checkbox" id="del<*id*>"></td>
	</td>
</tr>
{/for}
</table>






{if $pager!=""}
	<div id="listfooter">	
		<*pager*>
	</div>
{/if}
</div>
<div id="formshadow"></div>

<div id="image_window" class="image_tooltip"><img id="image_window_img"></div>




